home *** CD-ROM | disk | FTP | other *** search
- /*
- File: RoutineDescriptorEntry.c
-
- Contains: Routine Descriptor for main entry point
-
- Copyright: © 1994,1998 by Apple Computer, Inc., all rights reserved.
-
- */
-
- #include <Components.h>
-
- // ------------------------------------------------------------------------------------
- //
- // IF YOU BUILD A NATIVE POWERPC COMPONENT, YOU MUST USE A ROUTINE DESCRIPTOR INSTEAD
- // OF MAIN() AS YOUR MAIN ENTRY POINT
- //
- // A PowerPC code fragment has a well defined entry point. The Component Manager,
- // rather than just jumping to the start of the code resource, will call the main entry
- // point, as defined when linking, instead. But the Component Manager is 68K code, which
- // means your main entry point must be a RoutineDescriptor.
- //
- // When you link the component, you must specify MainRD as the entry
- //
- // Note: Your development environment may issue a warning because your main entry point
- // is in a data section, not a code section. You may ignore the warning.
- // Note: Some components rely on a "fast dispatching" mechanism for calling component
- // functions. This mechanism is dependent on the 68K architecture and is unsupported
- // for native components
-
-
- #ifdef powerc
-
- pascal ComponentResult main( ComponentParameters *params, Handle storage );
-
- enum {
- uppMainProcInfo = kPascalStackBased
- | RESULT_SIZE(SIZE_CODE(sizeof(ComponentResult)))
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(ComponentParameters *)))
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(Handle)))
- };
-
- RoutineDescriptor MainRD = BUILD_ROUTINE_DESCRIPTOR(uppMainProcInfo, main);
-
-
- #endif